package com.hsgene.order.constants;

/**
 * 商城订单状态枚举
 *
 * @author wangbing
 * @version 1.0, 2018/8/3
 */
public enum OrderSupplierStatus {

    NON_SAMPLE("non_sample", "样本待上传", "样本待上传"),

    SAMPLING("sampling", "待寄送样本", "待寄样本"),

    SAMPLE_DELIVERED("sample_delivered", "待收样", "待签收样本"),

    CONFIRMED_SAMPLE("confirmed_sample", "待寄检测报告", "待寄报告"),

    REPORT_DELIVERED("report_delivered", "待签收检测报告", "待签收报告"),

    CONFIRMED_REPORT("confirmed_report", "已签收", "已签收报告"),

    CANCELED("canceled", "已取消", "已取消"),

    UNDEFINED("undefined", "未定义的供应商订单状态", "未定义的供应商订单状态");

    /**
     * 编码
     */
    private final String code;

    /**
     * 描述(运营)
     */
    private final String desc;
    /**
     * 描述（机构）
     */
    private final String descSupplie;

    public static OrderSupplierStatus getEnum(String code) {
        for (OrderSupplierStatus status : values()) {
            if (status.code.equalsIgnoreCase(code)) {
                return status;
            }
        }

        return UNDEFINED;
    }

    OrderSupplierStatus(String code, String desc, String descSupplie) {
        this.code = code;
        this.desc = desc;
        this.descSupplie = descSupplie;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getDescSupplie() {
        return descSupplie;
    }

}
